<?php

namespace Laravist\Hasher;

class MD5Hasher
{
    /**
     * @param $value
     * @param array $optiphpons
     * @return false|string
     */
    public function make($value, $options=[])
    {
        $salt = isset($options['salt'])?$options['salt']:'';
        return hash('md5', $value.$salt);
    }

    /**
     * @param $value
     * @param $hash_value
     * @param array $options
     * @return bool
     */
    public function check($value, $hash_value, $options=[])
    {
        $salt = isset($options['salt'])?$options['salt']:'';
        return hash('md5', $value.$salt) === $hash_value;
    }
}
